<template>
	<view>
		<u-row customStyle="margin-top:32rpx">

			<u-col span="10" offset="1">
				<u--input placeholder="店铺名称" border="surround" v-model="shopName"></u--input>
			</u-col>
		</u-row>

		<u-row customStyle="margin-top:50rpx">
			<u-col span="10" offset="1">
				<u-button type="primary" @click="save" text="新增"></u-button>
			</u-col>
		</u-row>
	</view>
</template>

<script>
	var that
	var ERShoopManage = require('../../../../service/ERShoopManage.js'),
		mERShoopManage
	var UserInfo = require('../../../../service/UserInfo.js'),
		mUserInfo
	export default {
		data() {
			return {
				shopId: '',
				shopName: '',
				shopList: [],
				baseShop: {},
			}
		},
		onLoad(options) {
			that = this
			console.log(options)
			if (options) {
				that.fromScan = options.fromScan
				this.shopId = options.shopId
			}
			mERShoopManage = new ERShoopManage(this.mNetTool)
			mUserInfo = new UserInfo(this.mNetTool)
		},

		methods: {
			save() {
				let userInfo = uni.getStorageSync('userInfo')
				// mERShoopManage.save({
				// 	shop_name:'',
				// 	owner_id:user
				// })
				uni.showLoading({
					title: '添加中'
				})
				mERShoopManage.save({
					shop_name: that.shopName,
					owner_id: userInfo.id,
				}, r => {
					uni.navigateBack({})
				})
			}
		}
	}
</script>

<style>

</style>
